<!DOCTYPE html>
<html>
    <head>
        <title>{{$vo.title}} > {{$class['name']}} > {{:C('SITE_TITLE')}}</title>
    <meta name="keywords" content="<if condition="$vo['keyword'] neq ''">{{$class.keyword}}<else />{{:C('SITE_KEYWORDS')}}</if>" />
<meta name="description" content="<if condition="$vo['description'] neq ''">{{$class.description}}<else />{{:C('SITE_DESCRIPTION')}}</if>" />
<meta name="robots" content="all" />
<meta name="author" content="{:C('SITE_DP_AUTHOR')}" />
<link href="../Public/style/views.css" type="text/css" rel="stylesheet" />
<script>
    var checkUserUrl = '{{:U("Home/Public/checkUsername")}}';
  　var checkEmailUrl = '{{:U("Home/Public/checkEmail")}}';
    var checkVerifyUrl = '{{:U("Home/Public/checkVerify")}}';
    var verifyImgUrl = '{{:U("Home/Public/verify")}}';
</script>
<script src="__PUBLIC__/Js/jQuery/jquery-1.10.2.min.js"></script>
<!--<script src="../Public/js/checkReg.js"></script>-->

</head>
<body id="views">

<include file="Public:header" />
    <div id="position">{$position}</div>

    <div id="body">
        <div id="content">
            <div id="comment">

                <h3 class="comment_title">用户登录(<em style="color: red;">*</em>为必填项)</h3>
                <div id="comment_list"></div>
                <div id="comment_page"></div>

                <div id="comment_form" class="efbox">
                    <form method="post" id="login"  action="{{:U('Home/Public/checkLogin')}}">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>&nbsp;</td>
                    <td>
                        <div id="result" class="none result"
                             style="font-family:微软雅黑,Tahoma;letter-spacing:2px;color: red"></div>
                    </td>
                    </tr>
                            <tr>
                                <td >
                                    <span style="color: red;" >*</span>用户名:</td>
                                <td>
                                    <input name="username"  id="username"  class="txt" value="" style="width:280px;" />
                                
                                </td>
                            </tr>
                           <tr>
                                <td >
                                    <span style="color: red;" >*</span>密码:</td>
                                <td>
                                    <input type="password" name="password" id="pwd" class="txt" value="" style="width:280px;" />
                                    
                                </td>
                            </tr>
                            

                            <tr>
                                <td >
                                    <span style="color: red;" >*</span>验证码:</td>
                                <td>
                                    <input name="verify"  id="verify" class="txt" value="" style="width:228px;" />
                                    <img id="verifyImg" src="{{:U('Home/Public/verify')}}" onclick="changeVerify()" class="verifyImg" alt="点击刷新验证码" title="刷新验证码"/>
                                    
                                </td>
                            </tr>

                            <tr>
                                <td>&nbsp;</td>
                                <td > 
                                    <input type="button" class="do_post_com" value="登录" id="ajaxLogin"/>
                                  
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>

            </div>
        </div>

        <div id="slidebar">
            <include file="Public:slidebar" />
        </div>

        <div class="clear"></div>
    </div>

<include file="Public:footer" />
<script>
   var __login__ = {};
   __login__.evt = {
       URL:null,
       init:function() {
           //获取表单提交地址
           this.URL = $('#login').attr('action');
           $("#ajaxLogin").click(function() {
               $.ajax({
                   url:__login__.evt.URL,
                   type:"POST",
                   data:$("#login").serialize(),
                   cache:false,
                   success:function(data){
                       __login__.evt.complete(data);
                   }
               })
           })
       },
       
       //回调函数
       complete:function(data){
            if(data.status==1){
                alert('登录成功');
                window.location.href = data.data;
            } else {
                 $("#result").html(data.info).show;
            }
       }
   }
   
   //登录对象初始化,并绑定事件
   $(function () {
        __login__.evt.init();
    })


function changeVerify()
 {
     var timenow = new Date().getTime();     
     document.getElementById('verifyImg').src = verifyImgUrl+"?"+timenow;
}
</script>
</body>
</html>